package com.ruoyi.school.file.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.school.file.mapper.UploadFileMapper;
import com.ruoyi.school.file.domain.UploadFile;
import com.ruoyi.school.file.service.IUploadFileService;
import com.ruoyi.common.core.text.Convert;

/**
 * 文件上传Service业务层处理
 * 
 * @author qiang
 * @date 2022-07-03
 */
@Service
public class UploadFileServiceImpl implements IUploadFileService 
{
    @Autowired
    private UploadFileMapper uploadFileMapper;

    /**
     * 查询文件上传
     * 
     * @param id 文件上传主键
     * @return 文件上传
     */
    @Override
    public UploadFile selectUploadFileById(Long id)
    {
        return uploadFileMapper.selectUploadFileById(id);
    }

    /**
     * 查询文件上传列表
     * 
     * @param uploadFile 文件上传
     * @return 文件上传
     */
    @Override
    public List<UploadFile> selectUploadFileList(UploadFile uploadFile)
    {
        return uploadFileMapper.selectUploadFileList(uploadFile);
    }

    /**
     * 新增文件上传
     * 
     * @param uploadFile 文件上传
     * @return 结果
     */
    @Override
    public int insertUploadFile(UploadFile uploadFile)
    {
        return uploadFileMapper.insertUploadFile(uploadFile);
    }

    /**
     * 修改文件上传
     * 
     * @param uploadFile 文件上传
     * @return 结果
     */
    @Override
    public int updateUploadFile(UploadFile uploadFile)
    {
        return uploadFileMapper.updateUploadFile(uploadFile);
    }

    /**
     * 批量删除文件上传
     * 
     * @param ids 需要删除的文件上传主键
     * @return 结果
     */
    @Override
    public int deleteUploadFileByIds(String ids)
    {
        return uploadFileMapper.deleteUploadFileByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除文件上传信息
     * 
     * @param id 文件上传主键
     * @return 结果
     */
    @Override
    public int deleteUploadFileById(Long id)
    {
        return uploadFileMapper.deleteUploadFileById(id);
    }
}
